Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Grouping on A/c using if

Hi All,

I have account number and i want to do grouping(250+) on that account numbers like below

[Grouping A/c]                  A/c

11101000..11102599        .......

11102000..11102499        .......

11103000..11103999        .......

11200000..11299999        .......


I am achieving this using if condition like below


      if (Code>= 11101000 and Code <= 11102599,  '11101000..11102599',

      if (Code>= 11102000 and Code <= 11102499,  '11102000..11102499'

    , '0'    )) as [Grouping A/c]

My problem is that when i run above query for 250+ if statements qv is not allowing


Please suggest in other way


Error in expression:

"Too complex, more than 100 levels nesting"



Please any one can suggest in other way ...



Thanks

14 Replies
tresesco
MVP
MVP

Intervals look uneven in your case, hence class() solution might not be very helpful here. You could try the way using pick(match(.... as Pradosh has suggested above, or maintain a table with upper and lower bounds in a table and use it with intervalmatch().

shiveshsingh
Master
Master

Hi

Try it using pick(match())

prma7799
Master III
Master III
Author

Hi Pradosh ,

I have tried your solution but not getting  expected output.

PFA..

Thanks

pradosh_thakur
Master II
Master II

pfa

i have done for first few values please make sure you have no ambiguity in the intervals(they should not overlap) and there is wildmatch()+1 is done in the script to counter values which not in any boundry(bucket).

regards

Pradosh

Learning never stops.
MarcoWedel

Hi,

maybe helpful:

Custom Filter(unusual range)

regards

Marco