
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Switch Statement
Hi Guys,
Please I am trying to write a Switch Case Statement but I can figure it out.
For example I want to write a switch case statement instead of this "if" statement below:
if(max(Gas) < 25/10 , 'G1.6',
if(max(Gas) < 40/10 , 'G2.5')) and so on ...
I have attached the sample data source.
Thanks
- Tags:
- new_to_qlikview


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, there is no switch case conditional statement for use in a LOAD statement (there is one for use as a script excecution control statement (but not within a LOAD)).
You can maybe use an INTERVALMATCH to achieve what you want:
INPUT:
LOAD Klasse,
[Minimaal verbruik],
[Nominaal verbruik],
[Maximaal verbruik],
Verbruiksklasse,
Gas
FROM
[GasaansluitingenWiki.xlsx]
(ooxml, embedded labels, table is Blad1);
Intervals:
LOAD Klasse as GasClass,
[Minimaal verbruik] as Start,
Alt(Peek('Start')-1E-9, 1E9) as End
Resident INPUT Order by [Minimaal verbruik] desc;
JOIN
IntervalMatch (Gas) LOAD Start,End Resident Intervals;
DROP TABLE INPUT;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe this works:
PICK ( WILDMATCH (Gas, <25/10, <40/10), 'G1.6','G2.5') AS xGas
