Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
I need modify a expression of bar char, but not look the path.
I have this char, that works with this expression:
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}>} SOLI_ID_SOLICITUD)
And this is my problem:
The results depending of filters, are these:
The numbers in red are that I need change. The results I want are these:
Explain with a example:
Filter -> "Rev0,Rev1,Rev2"
Static values for Rev0 in Ene and Feb, static values for Rev1 in Mar and Abr, and since May to Dic., values of Rev2.
Conclusion: static values for Revs checked and rest of values of the last Rev checked.
Any idea?
Thanks.
Since I don't have access to your data source, I will give your something which may or may not work.... but at least we can try. Add this table to your script
SortSelectorAnual:
LOAD DISTINCT
[Selector Anual],
RowNo() as Sort
Resident SelectorAnual
Order By [Selector Anual];
and change your expression to this:
If(GetSelectedCount([Selector Anual]) = 1 and Len(Trim([Selector Anual])) > 4,
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}>} SOLI_ID_SOLICITUD),
If(Len(Trim([Selector Anual])) = 4,
Only({<[Selector Anual]>}Aggr(If(RowNo() = NoOfRows(),
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}, [Selector Anual]>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}, [Selector Anual]>} SOLI_ID_SOLICITUD)), Mes, Sort)),
Only(Aggr(If(RowNo() = NoOfRows(),
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}>} SOLI_ID_SOLICITUD)), Mes, Sort))))
Again, I don't know if this will work or not, but worth giving a shot.
Best,
Sunny
Forgot explain each Rev corresponds to two months, in order: Rev0 (Ene, Feb), Rev1 (Mar, Abr).........
Thanks
Also forgot show the dates that I have:
Thanks
please post a sample, it'll be easier to assist
Create a sample is difiicult (need three tables, many data...) , and can´t share the .qw, confidentially policy with client. Sorry.
See if this can help you create a sample
Preparing examples for Upload - Reduction and Data Scrambling
Ok, share the .qw scrambled and reduced.
Thanks. Wait your help.
Try this expression:
If(GetSelectedCount([Selector Anual]) = 1 and Len(Trim([Selector Anual])) > 4,
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}>} SOLI_ID_SOLICITUD),
If(GetSelectedCount([Selector Anual]) = 2,
Only(Aggr(If(RowNo() = NoOfRows(),
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}>} SOLI_ID_SOLICITUD)), Mes, ([Selector Anual], (TEXT)))),
Only({<[Selector Anual]>}Aggr(If(RowNo() = NoOfRows(),
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'Rev0'}, [Selector Anual]>} SOLI_ID_SOLICITUD) +
count(DISTINCT {<[Tipo Fecha]={$(vTipoFecha)}, Foto={'Publicación anual'}, [Revisión plan anual] = {'*'} - {'Rev0'}, ESSO_ID_ESTADO_BLOQ={1}, [Selector Anual]>} SOLI_ID_SOLICITUD)), Mes, ([Selector Anual], (TEXT))))))
This will only work if you have QV12, if you don't then you have to sort the Selector Anual field in the script for this to work properly. I can help you with that if you don't have QV12, but if you do then check out the attachment
Hi,
My version is 11.20. Sorry, I´m beginner in Qlik, don´t know that you say with "sort the Selector Anual field in the script".
Your expression show errors and not works:
I proved in local with Qlik 12, and not show errors in expression, and works, but not completely good.
Example:
This expression is difficult for a beginner -_-''
Thanks.
That is fixed, but there might be another combination which might not fixed. Since there are so many combinations, it tends to get tricky. But since you have a better idea, can you check....