Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik friends,
I have a little questions for you.
Maybe you know a way how the problem could be solved. I would like to remove rows in a table.
Year | MonthNo | Type |
---|---|---|
2018 | 01 | FC |
2018 | 01 | BUDGET |
2018 | 01 | ACTUAL |
2018 | 02 | FC |
2018 | 02 | BUDGET |
2018 | 02 | ACTUAL |
2018 | 03 | FC |
2018 | 03 | BUDGET |
2018 | 04 | FC |
2018 | 04 | ACTUAL |
I would like to remove the rows which contains FC, if the same Year and MonthNo contains ACTUAL.
Hopefully, I could explain my little problem.
Thank you very much for your support.
Best regards,
Replace the Type dimension with a measure with this expression: only({<Type -= {'FC'} >}Type)
Thanks for your answer, I would like to do it in the Script.
I tried it with a Where Clause, but its not the correct way.
Table:
Load * Inline [
Year, MonthNo, Type
2018, 01, FC
2018, 01, BUDGET
2018, 01, ACTUAL
2018, 02, FC
2018, 02, BUDGET
2018, 02, ACTUAL
2018, 03, FC
2018, 03, BUDGET
2018, 04, FC
2018, 04, ACTUAL
];
1. Where Type <> 'FC'
2. Where Not Match(Type, 'FC')
Try this
Table:
Load Year*100+MonthNo as YearMonth,
*
;
Load * Inline [
Year, MonthNo, Type
2018, 01, FC
2018, 01, BUDGET
2018, 01, ACTUAL
2018, 02, FC
2018, 02, BUDGET
2018, 02, ACTUAL
2018, 03, FC
2018, 03, BUDGET
2018, 04, FC
2018, 04, ACTUAL
];
TableActual:
Load YearMonth as YearMonth_ACTUAL Resident Table
where [Type] = 'ACTUAL' ;
Data:
NoConcatenate
Load * Resident Table where not Exists(YearMonth_ACTUAL,YearMonth) and [Type] = 'FC' ;
Concatenate(Data)
Load * Resident Table where [Type] <> 'FC' ;
Drop Table Table ;
DROP TablE TableActual ;