Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I have below table and i wann create flag in the backend
ID , Country/City
1,AS
1,BU
1,AP
2,ZZ
2,UP
When create the flag backend .
When i click ID -1 in front end, For country AS,BU,AP it should be 'Y' and for 'N' for ZZ,UP
similarly when i click on ID-2 . 'Y' as ZZ,UP and 'N' to AS,BU,AP .
Advance Thanks
Ram
You can do it via script but it will be complex as flag need to be changed dynamically based on selection. So it will be better to do it in frond end instead. You can get it worked on multiple selections as well.
LOAD *
Inline [
ID , Country
1,AS
1,BU
1,AP
2,ZZ
2,UP
3,NP
3,KP] ;
Create variable on front end named vIDSelection with below expression
=GetFieldSelections(ID)
Create straight table with Dimension Country ,ID and below calculated dimension for Flag
=aggr(if(GetSelectedCount(ID)=0,'Y',
if(Index(vIDSelection,only({1}ID)),'Y','N')),Country)
create a measure in straight table to exclude ID selection and then you can hide this column or you can include below highlighted set in other measure
=count({<ID>}Country)
You can do it via script but it will be complex as flag need to be changed dynamically based on selection. So it will be better to do it in frond end instead. You can get it worked on multiple selections as well.
LOAD *
Inline [
ID , Country
1,AS
1,BU
1,AP
2,ZZ
2,UP
3,NP
3,KP] ;
Create variable on front end named vIDSelection with below expression
=GetFieldSelections(ID)
Create straight table with Dimension Country ,ID and below calculated dimension for Flag
=aggr(if(GetSelectedCount(ID)=0,'Y',
if(Index(vIDSelection,only({1}ID)),'Y','N')),Country)
create a measure in straight table to exclude ID selection and then you can hide this column or you can include below highlighted set in other measure
=count({<ID>}Country)
Hi Kush ,
thanks for replying , i need it on back-end as i have other calculations & need to store in qvd .
Just to change the question a bit
Instead of Flag , can i somehow map ID-1 to ZZ,UP country and ID-2 to AS,BU,AP country
( its basically mapping ID's to greyed out Countries list )
This also can work for me .
Please note i have millions of record , Outer join could get the app hanged mostly
Now I bit confused that what was your question.
Originally it was " When i click ID -1 in front end, For country AS,BU,AP it should be 'Y' and for 'N' for ZZ,UP"
Now,Instead of Flag , can i somehow map ID-1 to ZZ,UP country and ID-2 to AS,BU,AP country .
These are totally different. Can you please provide with example what exactly do you need?
Sorry for making it confusing , Below is example So for ID-1 is mapped for Ind ,Aus,Pak and ID-2 as SA , US
what i need is reverse mapping ( map ID-1 to SA, US and map ID-2 to Ind,Aus,Pak )
so basically for each ID mapping the grey out country list should be mapped
Output required : ( So for ID-1 , SA and US should be in white and Ind , Aus , Pak should be greyed out )
similarly for ID-2
Hope I'm clear .
Please note : i could required in backend and data has millions of record so any joins could mostly hang
There could be many ID's in your data so let's say there is ID 3 with other country. So when you select ID=1, it include all the other ID's country? What if you select ID 1 & ID 2 both?
Yes for ID=1 , it could include all other ID's country as well ( all greyed out values ).
I'm looking for each ID calculated in create table /data out of it . So for each ID , it could include all other ID's country as well . There is no selecting of ID's here
hope I'm clear
Is there any specific reason you want to do this way? Because it will complicate the things. If I know the reason then I could advise better way of doing it