# Third-Party Qlik Jobs

Highlighted
New Contributor

## Qliksense Expression

I have the below expression

If(Match(([Grv1 Date]-[In DC Date]),1,2,3,4,5,6,7),'1-7 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),8,9,10,11,12,13,14),'8-14 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),15,16,17,18,19,20,21),'15-21 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),22,23,24,25,26,27,28),'22-28 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),0,-1,-2,-3,-4,-5,-6,-7),'On Time',
If(Match(([Grv1 Date]-[In DC Date]),-8,-9,-10,-11,-12,-13,-14),'More than 7 Days Early',
If(Match(([Grv1 Date]-[In DC Date]),-15,-16,-17,-18,-19,-20,-21),'More than 14 Days Early',
If(Match(([Grv1 Date]-[In DC Date]),-22,-23,-24,-25,-26,-27,-28),'More than 21 Days Early',
'28 Days Late'))))))))

I need to replace ([Grv1 Date]-[In DC Date]) in above expression with if([Grv1 Date],([In DC Date]-[Grv1 Date]),([In DC Date]-[Grv2 Date]))

Labels (10)

2 Replies
MVP

## Re: Qliksense Expression

Try this may be

If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),1,2,3,4,5,6,7),'1-7 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),8,9,10,11,12,13,14),'8-14 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),15,16,17,18,19,20,21),'15-21 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),22,23,24,25,26,27,28),'22-28 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),0,-1,-2,-3,-4,-5,-6,-7),'On Time',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-8,-9,-10,-11,-12,-13,-14),'More than 7 Days Early',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-15,-16,-17,-18,-19,-20,-21),'More than 14 Days Early',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-22,-23,-24,-25,-26,-27,-28),'More than 21 Days Early',
'28 Days Late'))))))))

New Contributor

## Re: Qliksense Expression

Thank you, works perfectly.