Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlik_
Creator
Creator

Função Class() apresentando em decimal

Boa tarde gente

eu preciso fazer essa função no Qlikview, e trazer da forma abaixo,porém não tem essas funções la.

Alguem consegue me ajudar como trazer de forma similar.

Por exemplo, ao escolher a faixa 30, ele deve apresentar de R$ 0,00 - R$ 29,99

e no qlikview só consigo mostrar dessa forma

ou no máximo assim

5 Replies
qlik_
Creator
Creator
Author

Para um relatório em PHP consigo calcular desta forma e apresentar assim

FLOOR(ABS(VLR_BASE_CALCULO)/@FAIXA) * @FAIXA AS VLR_FAIXA_INI,

CASE WHEN (FLOOR(ABS(VLR_BASE_CALCULO)/@FAIXA) * @FAIXA) = (CEILING(ABS(VLR_BASE_CALCULO)/@FAIXA) * @FAIXA)

THEN

       ((CEILING(ABS(VLR_BASE_CALCULO)/@FAIXA) * @FAIXA) + @FAIXA) - 0.01

ELSE

       (CEILING(ABS(VLR_BASE_CALCULO)/@FAIXA) * @FAIXA) - 0.01

END AS VLR_FAIXA_FIM


MarcoWedel

Boa tarde carla,


one solution for this question could be:


Dual(Num(SubField(Class(value,30),' <= x < ',1),'R$ #.##0,00')&' - '&Num(SubField(Class(value,30),' <= x < ',2)-0.01,'R$ #.##0,00'),Class(value,30))

QlikCommunity_Thread_141673_Pic1.JPG.jpg


QlikCommunity_Thread_141673_Pic4.JPG.jpg

Due to the creation of dual values, you even don't have to care about sorting expressions:

QlikCommunity_Thread_141673_Pic2.JPG.jpg


QlikCommunity_Thread_141673_Pic3.JPG.jpg


LOAD *,

    Dual(Num(SubField(Class(value,30),' <= x < ',1),'R$ #.##0,00')&' - '&Num(SubField(Class(value,30),' <= x < ',2)-0.01,'R$ #.##0,00'),Class(value,30)) as class;

LOAD Round(Rand()*1100,0.01) as value

AutoGenerate 200;

hope this helps

regards

Marco

MarcoWedel

or using dynamic front end expressions:

QlikCommunity_Thread_141673_Pic5.JPG.jpg

QlikCommunity_Thread_141673_Pic6.JPG.jpg

hope this helps

regards

Marco

qlik_
Creator
Creator
Author

Marco

Thank you so much

perfect solution

Carla

MarcoWedel

Hi,

thanks, you're welcome.

Please close this thread, if there are no further questions.

thanks

regards

Marco