Forum Discussion

luvnet18's avatar
luvnet18
New Member
4 years ago
Solved

Show data (not measure) from different column based on selection

Question:
Show data (not measure) from different column based on selection
How to make the generic field that show value from diff column depending on "PromoType" selection?
By right, i will need to have below formulated field created
[Customer]
[Promo Tag1]
[Promo Tag2]
[Promo Unit]

Requirement:
- Only 1 table is needed
- The Table Field Header will be Generic (Customer/Promo Tag1/ Promo Tag2/Promo Unit), and not Promo1_Tag1/etc etc
- Not only needed the measure sum(unit), but also want to see the Customer/Tag1/Tag2

Note:
There is overlapping of customer purchasing from the 3 Promo (i.e. Sandy buying from 3 Promo)

Sample data

CustomerPromo1_Tag1Promo1_Tag2Promo1_UnitPromo2_Tag1Promo2_Tag2Promo2_UnitPromo3_Tag1Promo3_Tag2Promo3_Unit
Abu         
MichelleStationeryPencil5      
MichelleStationeryEraser1FoodMeat3   
Michael         
Sandy      BooksFiction1
SandyStationeryBooks3FoodMeat1BooksNovel2
SandyStationeryPencil3FoodVegetables2BooksCooking1
Ming         
Chu         
Sam   FoodFruits1   
Sam   FoodVegetables5   
Andy         
KrishnanStationeryEraser1FoodVegetables2   
Samuel   FoodMeat2BooksNovel1
Samuel   FoodFruits4   
Katherine         
Jenny      BooksCooking2
Mr.OngStationeryPencil2      
Ms.LimStationeryPencil1   BooksFiction2


Example of what is needed:-

1) will have a simple table created that allow selection of Promo    
         
PromoType        
Promo1        
Promo2        
Promo3        
         
2a) When [PromoType] selected 'Promo1', will show the below    
The Table Field Header will be Generic, and not Promo1/Promo2/Promo3If drill up to Promo Tag1, will show 
         
CustomerPromo Tag1Promo Tag2Promo Unit CustomerPromo Tag1Promo Unit 
MichelleStationeryPencil5 MichelleStationery6 
MichelleStationeryEraser1 SandyStationery6 
SandyStationeryBooks3 KrishnanStationery1 
SandyStationeryPencil3 Mr.OngStationery2 
KrishnanStationeryEraser1 Ms.LimStationery1 
Mr.OngStationeryPencil2     
Ms.LimStationeryPencil1     
         
2b) When [PromoType] selected 'Promo2', will show below on the same tableIf drill up to Promo Tag1, will show 
         
CustomerPromo Tag1Promo Tag2Promo Unit CustomerPromo Tag1Promo Unit 
MichelleFoodMeat3 MichelleFood3 
SandyFoodMeat1 SandyFood3 
SandyFoodVegetables2 SamFood6 
SamFoodFruits1 KrishnanFood2 
SamFoodVegetables5 SamuelFood6 
KrishnanFoodVegetables2     
SamuelFoodMeat2     
SamuelFoodFruits4     
         
2c) When [PromoType] selected 'Promo3', will show below on the same tableIf drill up to Promo Tag1, will show 
         
CustomerPromo Tag1Promo Tag2Promo Unit CustomerPromo Tag1Promo Unit 
SandyBooksFiction1 SandyBooks4 
SandyBooksNovel2 SamuelBooks1 
SandyBooksCooking1 JennyBooks2 
SamuelBooksNovel1 Ms.LimBooks2 
JennyBooksCooking2     
Ms.LimBooksFiction2     






  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi luvnet18 ,

     

    You could create a new table.

    Divide the original table into three tables and append them using the union() function.

    new table = 
    var table1 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo1_tag1],"promo tag2",[promo1_tag2],"promo unit",[promo1_unit],"promotype","promo1")
    var table2 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo2_tag1],"promo tag2",[promo2_tag2],"promo unit",[promo2_unit],"promotype","promo2")
    var table1 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo3_tag1],"promo tag2",[promo3_tag2],"promo unit",[promo3_unit],"promotype","promo3")
    result
    union(table1,table2,table3)

    Then create a slicer table:

    PromoType
    Promo1
    Promo2
    Promo3

    At last create a relationship between new table and slicer table by PromoType column.

     

    Best Regards,

    Jay

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi luvnet18 ,

     

    You could create a new table.

    Divide the original table into three tables and append them using the union() function.

    new table = 
    var table1 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo1_tag1],"promo tag2",[promo1_tag2],"promo unit",[promo1_unit],"promotype","promo1")
    var table2 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo2_tag1],"promo tag2",[promo2_tag2],"promo unit",[promo2_unit],"promotype","promo2")
    var table1 = selectedcolumn('table',"customer",[customer],"promo tag1",[promo3_tag1],"promo tag2",[promo3_tag2],"promo unit",[promo3_unit],"promotype","promo3")
    result
    union(table1,table2,table3)

    Then create a slicer table:

    PromoType
    Promo1
    Promo2
    Promo3

    At last create a relationship between new table and slicer table by PromoType column.

     

    Best Regards,

    Jay