Ir para conteúdo
Fórum Script Brasil
  • 0

Minimum Formula


Guest --Marco --

Pergunta

Guest --Marco --

Hello. I had a column in details section that use to have 8 records. the first 4 are always zero. I need to insert a formula in report footer that shows me the Minimum value, but I don't want that the formulares reads/ uses the first 4 records. Imagine this:

ID Value

1 0

2 0

3 0

4 0

5 5

6 3

7 7

8 9

I need that my minimum formula uses only the records with ID number 5; 6; 7; 8

Can you please help?

Best Regards,

Marco

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

You can create a Formula Field that exchanges the 0 values for the maximum value of this field. The formula would look like this in Basic Syntax:

If {Tabela.Campo} = 0 Then
    Formula = Maximum ({Tabela.Campo})
Else
    Formula = {Tabela.Campo}
End If[/code]

And then, you get the minimum value of this formula field instead of the field from your table.

The problem is that Crystal doesn't allow you to make a summary of a field that already have a summary in its formula (in this case, you already have the maximum summary). But there's a bug that allows you to do so. You just have to create the field and put any value in it (with no summaries), then save it and insert its minimum value in the report. Then you edit this field and paste the formula above. After this, although you can't create new summaries from this field, the one you have already created will remain there.

Other way to do this is replace the maximum value in the formula for a value that you know it's greater than any other you may have in your db.

Link para o comentário
Compartilhar em outros sites

  • 0
Guest --Marco --

Olá. Obrigado pela tua resposta.

A formula devolve-me um erro. Diz que espera uma string, bolean ou number.

Eu tentei inseri-la no rodape do relatorio e no grupo de relatório.

Alguma ideia?

Obrigado,

Marco

You can create a Formula Field that exchanges the 0 values for the maximum value of this field. The formula would look like this in Basic Syntax:

If {Tabela.Campo} = 0 Then
    Formula = Maximum ({Tabela.Campo})
Else
    Formula = {Tabela.Campo}
End If

And then, you get the minimum value of this formula field instead of the field from your table.

The problem is that Crystal doesn't allow you to make a summary of a field that already have a summary in its formula (in this case, you already have the maximum summary). But there's a bug that allows you to do so. You just have to create the field and put any value in it (with no summaries), then save it and insert its minimum value in the report. Then you edit this field and paste the formula above. After this, although you can't create new summaries from this field, the one you have already created will remain there.

Other way to do this is replace the maximum value in the formula for a value that you know it's greater than any other you may have in your db.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,5k
×
×
  • Criar Novo...